@import './skeleton.css';

/* 轻量自定义：卡片排版与响应式 */
/* Spacing and type values mapped to design tokens */
.c-cert-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(min(var(--size-cert-card), 100%), 1fr));
  padding: var(--space-7) 0;
}
.c-credly-container {
  background: var(--color-surface);
  border-radius: var(--radius-s);
  margin: var(--space-4) auto;
  max-width: var(--size-credly-badge);
  min-height: var(--size-credly-badge);
  overflow: hidden;
  padding: var(--space-2);
  position: relative;

  iframe {
    opacity: 0;
    transition: opacity var(--duration-normal) var(--easing-standard);
  }

  &.is-loaded iframe {
    opacity: 1;
  }

  .c-credly-skeleton,
  .c-credly-error {
    align-items: center;
    display: flex;
    inset: 0;
    justify-content: center;
    position: absolute;
    z-index: 10;
  }

  .c-credly-skeleton {
    background: var(--color-border);
    overflow: hidden;
  }

  &.is-loaded .c-credly-skeleton {
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-normal) var(--easing-standard);
  }

  .c-credly-error {
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--font-size-1);
    padding: var(--space-2);
    text-align: center;
  }
}

/* Certification card */
.c-cert-card {
  background: var(--color-surface);
  border: var(--border-0);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-elevation-1);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  text-align: center;

  &:focus-visible {
    box-shadow: var(--shadow-elevation-1), var(--focus-ring);
    outline: none;
  }

  h2 {
    font-size: var(--font-size-2);
    margin-bottom: var(--space-1);
  }

  p {
    margin: 0;
  }

  .c-verify-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;

    /* Verification buttons share gradient via .c-btn-primary; only layout here */
    .c-verify-btn {
      flex: 1 1 auto;
    }
  }
}

.c-cert-page {
  container-type: inline-size;
  min-height: 100vh;
  padding: 0;

  h1 {
    margin-top: var(--space-6);
    text-align: center;
  }
}
